<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/blog/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://guodh.gitee.io/blog').hostname,
    root: '/blog/',
    scheme: 'Pisces',
    version: '7.7.1',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":true,"show_result":true,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="作为一个后端开发对于分布式的理解少的可怜，这也难怪国内和国外的程序员有差距了吧，感觉是应该好好学习一波了。 Paxos算法的目的是：保证所有的机器在即使有部分crash的情况下，也能得出一致的结果。所以说，如果你说Paxos是强一致算法的话其实是错误的，应该是让机器达成共识。(￣▽￣)~*  Paxos作为分布式最经典的算法，可以简单的分为两种（其实演化的有好多种，主要是这两种）Basic Pax">
<meta property="og:type" content="article">
<meta property="og:title" content="Paxos算法">
<meta property="og:url" content="https://guodh.gitee.io/blog/2017/10/03/2017/Paxos%E7%AE%97%E6%B3%95/index.html">
<meta property="og:site_name" content="蛋蛋的小屋">
<meta property="og:description" content="作为一个后端开发对于分布式的理解少的可怜，这也难怪国内和国外的程序员有差距了吧，感觉是应该好好学习一波了。 Paxos算法的目的是：保证所有的机器在即使有部分crash的情况下，也能得出一致的结果。所以说，如果你说Paxos是强一致算法的话其实是错误的，应该是让机器达成共识。(￣▽￣)~*  Paxos作为分布式最经典的算法，可以简单的分为两种（其实演化的有好多种，主要是这两种）Basic Pax">
<meta property="og:locale">
<meta property="og:image" content="https://olwr1lamu.qnssl.com/raft.png">
<meta property="article:published_time" content="2017-10-03T09:21:52.000Z">
<meta property="article:modified_time" content="2017-10-30T14:14:13.000Z">
<meta property="article:author" content="RunningEgg">
<meta property="article:tag" content="技术">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://olwr1lamu.qnssl.com/raft.png">

<link rel="canonical" href="https://guodh.gitee.io/blog/2017/10/03/2017/Paxos%E7%AE%97%E6%B3%95/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>Paxos算法 | 蛋蛋的小屋</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">蛋蛋的小屋</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">来了就看看吧，没有刀剑只有故事</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-fw fa-home"></i>Home</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/blog/about/" rel="section"><i class="fa fa-fw fa-user"></i>About</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>Archives</a>

  </li>
        <li class="menu-item menu-item-book">

    <a href="/blog/book/" rel="section"><i class="fa fa-fw fa-archive"></i>book</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-Hans">
    <link itemprop="mainEntityOfPage" href="https://guodh.gitee.io/blog/2017/10/03/2017/Paxos%E7%AE%97%E6%B3%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="RunningEgg">
      <meta itemprop="description" content="写下我的点点滴滴，写下我对这个世界的看法，还有我内心锁崇拜的技术">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="蛋蛋的小屋">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Paxos算法
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2017-10-03 17:21:52" itemprop="dateCreated datePublished" datetime="2017-10-03T17:21:52+08:00">2017-10-03</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2017-10-30 22:14:13" itemprop="dateModified" datetime="2017-10-30T22:14:13+08:00">2017-10-30</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>作为一个后端开发对于分布式的理解少的可怜，这也难怪国内和国外的程序员有差距了吧，感觉是应该好好学习一波了。</p>
<p>Paxos算法的目的是：保证所有的机器在即使有部分crash的情况下，也能得出一致的结果。所以说，如果你说Paxos是强一致算法的话其实是错误的，应该是让机器达成共识。(￣▽￣)~* </p>
<p>Paxos作为分布式最经典的算法，可以简单的分为两种（其实演化的有好多种，主要是这两种）Basic Paxos和Multi Paxos。</p>
<p>如果英文好的话：可以直接看视频<br>资料来源：<a href="https://ramcloud.stanford.edu/~ongaro/userstudy/paxos.pdf">https://ramcloud.stanford.edu/~ongaro/userstudy/paxos.pdf</a><br>视频资源：<a href="https://www.youtube.com/watch?v=JEpsBg0AO6o&amp;t=584s">https://www.youtube.com/watch?v=JEpsBg0AO6o&amp;t=584s</a></p>
<h2 id="Basic-Paxos"><a href="#Basic-Paxos" class="headerlink" title="Basic Paxos"></a>Basic Paxos</h2><h3 id="目标"><a href="#目标" class="headerlink" title="目标"></a>目标</h3><p>Basic Paxos所要达到的目标有两个：</p>
<h4 id="1-safety"><a href="#1-safety" class="headerlink" title="1. safety"></a>1. safety</h4><ul>
<li>只有一个“提议”被选择</li>
<li>被选择的“提议”一定来自所属机器</li>
</ul>
<h4 id="2-Liveness"><a href="#2-Liveness" class="headerlink" title="2. Liveness"></a>2. Liveness</h4><ul>
<li>“提议” 最终会达成一致</li>
<li>如果“提议”达成一致，所有的机器都能感知到（包括挂掉的机器后来恢复了）</li>
</ul>
<h3 id="成员"><a href="#成员" class="headerlink" title="成员"></a>成员</h3><p>Proposers（提议者）和 Acceptors （接受者）</p>
<h3 id="提议Proposal组成"><a href="#提议Proposal组成" class="headerlink" title="提议Proposal组成"></a>提议Proposal组成</h3><table>
<thead>
<tr>
<th align="left">组成</th>
<th align="right">回合数</th>
<th align="center">服务器ID</th>
</tr>
</thead>
<tbody><tr>
<td align="left">组成</td>
<td align="right">Round Numver</td>
<td align="center">Server Id</td>
</tr>
</tbody></table>
<p>每个机器保存最大的回合数，机器不接受回合数小于当前回合数的提议。<br>服务器ID保证提议来自集群，同时一个服务器只产生一个提议。</p>
<h3 id="两阶段到达"><a href="#两阶段到达" class="headerlink" title="两阶段到达"></a>两阶段到达</h3><h4 id="阶段一：通知准备"><a href="#阶段一：通知准备" class="headerlink" title="阶段一：通知准备"></a>阶段一：通知准备</h4><ul>
<li>找出所有的提议</li>
<li>锁住所有的提议，直到完成</li>
</ul>
<h4 id="阶段二：通知接受"><a href="#阶段二：通知接受" class="headerlink" title="阶段二：通知接受"></a>阶段二：通知接受</h4><ul>
<li>询问Acceptors接受提议</li>
</ul>
<h3 id="两阶段过程"><a href="#两阶段过程" class="headerlink" title="两阶段过程"></a>两阶段过程</h3><table>
<thead>
<tr>
<th align="left">Basic Paxos</th>
<th align="right">Proposers</th>
<th align="center">Acceptos</th>
</tr>
</thead>
<tbody><tr>
<td align="left">第一步</td>
<td align="right">生成一个提议号码n（递增）</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">第二步</td>
<td align="right">通知提议Proposal(n)到所有机器</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">第三步</td>
<td align="right"></td>
<td align="center">如果n大于当前的回合数，则回应，return AcceptedValue(n)</td>
</tr>
<tr>
<td align="left">第四步</td>
<td align="right">如果大多数服务器返回接受,则将acceptedProposal更新为acceptedValue</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">第五步</td>
<td align="right">广播Accept(n, value)到所有机器</td>
<td align="center"></td>
</tr>
<tr>
<td align="left">第六步</td>
<td align="right"></td>
<td align="center">回应接受Accept(n, value)</td>
</tr>
<tr>
<td align="left">第七步</td>
<td align="right">如果result的中存在返回的result中回合数大于n的重新返回第一步，否则这个提议被选中</td>
<td align="center"></td>
</tr>
</tbody></table>
<p><strong>Acceptors must record minProposal, acceptedProposal,and acceptedValue on stable storage (disk)</strong></p>
<h3 id="缺点"><a href="#缺点" class="headerlink" title="缺点:"></a>缺点:</h3><p>难实现<br>效率低（两次RPC）<br>活锁（解决方案：Random TimeOut）</p>
<h2 id="Multi-Paxos"><a href="#Multi-Paxos" class="headerlink" title="Multi Paxos"></a>Multi Paxos</h2><p>Multi Paxos是基于Basic Paxos提出来的，通过选举出一个Leader，来减少RPC调用（只要Leader不挂，就不需要再次选举）。</p>
<p>具体的实现可以看下文的Raft，Raft只是Multi Paxos的简化实践版本。</p>
<h2 id="Raft-Consensus-Algorithm"><a href="#Raft-Consensus-Algorithm" class="headerlink" title="Raft Consensus Algorithm"></a>Raft Consensus Algorithm</h2><p>动画演示地址：<a href="http://thesecretlivesofdata.com/raft/">http://thesecretlivesofdata.com/raft/</a></p>
<h3 id="三个状态"><a href="#三个状态" class="headerlink" title="三个状态"></a>三个状态</h3><p>Follower、Candidate、Leader<br>其实就只有两个（Follower和Leader），当失去Leader，Follower会成为Candidate，尝试去成为Leader。</p>
<h3 id="两个Time-Out"><a href="#两个Time-Out" class="headerlink" title="两个Time Out"></a>两个Time Out</h3><p>上文说道，其实节点只有两种状态Follower和Leader，两个Time Out就是各自的时间钟。</p>
<ul>
<li><p>Election Time Out<br>Election Time Out 是Follower的时间钟，如果Follower在Election Time Out时间内没有收到Heart Beat，那么就认为Leader已经挂掉，那么此时这个节点会申请成为Leader。同时存在这种情况，两个节点同时发出了申请，解决方案就是各自随机一个时间（random time）进行选举，random time小的那个会先向所有的节点发出申请。</p>
</li>
<li><p>Heart Beat Time Out<br>节点成为Leader之后，需要每隔Heart Beat Time Out向节点发送心跳，告知自己是存活的。而且这个Heart Beat不仅仅是Heart Beat，有时还包括了写请求。</p>
</li>
</ul>
<h3 id="Leader-election"><a href="#Leader-election" class="headerlink" title="Leader election"></a>Leader election</h3><p>上面也已经讲了，每个节点都有一个自己的时间钟，在Time out这间没有收到请求，那么节点就认为Leader挂了，就会申请成为Leader。此时，如果收到了n/2+1的同意，就能成为Leader。所以节点数一般都是3，5，7，这样保证了，即使因为网络隔断，节点之间存在分区。比如5个节点，可能2，3分区，这样的情况下3个节点的分区仍能够选出Leader。</p>
<h3 id="Log-Replition"><a href="#Log-Replition" class="headerlink" title="Log Replition"></a>Log Replition</h3><p>日志提交也分为两步<br>第一步：Leader先自己将请求写入log，然后向所有节点发出写请求，每个节点收到请求（请求和Basic paxos一样，包含回合数），并将情切写到log中，同时节点如果成功将请求写入log，返回信息给Leader。</p>
<p>第二部：Leader接收到节点的返回值，如果数量大于n/2+1，那么认为这个是成功的，自己将log中请求commit，通知所有节点commit。</p>
<img src="https://olwr1lamu.qnssl.com/raft.png" width="70%" height="70%" alt="Log Replition过程"/>

<p>需要补充的是：log包含有log index和term number。Leader记住最大的log index。<br>当一个leader重新选举出来的时候（这是可能存在分区状况，例如上面说的情况），leader的log可能更fowller的log不一致，会强制follower与它一致。会先找出之间编号一致最大的log，从后面的覆盖掉。</p>
<h2 id="ZAB算法"><a href="#ZAB算法" class="headerlink" title="ZAB算法"></a>ZAB算法</h2><p>ZAB算法和Raft算法类似，zookeeper就是用的ZAB算法，不同的是ZAB是由follower向Leader发送心跳。类似一个push，一个是pull的感觉。</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>Raft是最好理解的版本，有兴趣的同学可以动手实现一下。这里是MIT大学的作业，使用Go实现Raft等算法的，博主也正在尝试中。<br>地址：<a href="http://www.jianshu.com/p/fcda437e560a">http://www.jianshu.com/p/fcda437e560a</a><br>网上的老司机的作业答案：<a href="https://github.com/happyer/distributed-computing">https://github.com/happyer/distributed-computing</a><br>记得给他们点个赞。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/blog/tags/%E6%8A%80%E6%9C%AF/" rel="tag"># 技术</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2017/09/30/2018/%E4%BA%8B%E4%BB%B6%E9%A9%B1%E5%8A%A8%E6%A8%A1%E5%9E%8B/" rel="prev" title="事件驱动模型">
      <i class="fa fa-chevron-left"></i> 事件驱动模型
    </a></div>
      <div class="post-nav-item">
    <a href="/blog/2017/10/12/2017/Spring%E4%BA%8B%E5%8A%A1%E4%BB%A5%E5%8F%8A%E5%88%86%E5%B8%83%E5%BC%8F%E4%BA%8B%E5%8A%A1/" rel="next" title="Spring事务以及分布式事务">
      Spring事务以及分布式事务 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Basic-Paxos"><span class="nav-number">1.</span> <span class="nav-text">Basic Paxos</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%9B%AE%E6%A0%87"><span class="nav-number">1.1.</span> <span class="nav-text">目标</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-safety"><span class="nav-number">1.1.1.</span> <span class="nav-text">1. safety</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-Liveness"><span class="nav-number">1.1.2.</span> <span class="nav-text">2. Liveness</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%88%90%E5%91%98"><span class="nav-number">1.2.</span> <span class="nav-text">成员</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8F%90%E8%AE%AEProposal%E7%BB%84%E6%88%90"><span class="nav-number">1.3.</span> <span class="nav-text">提议Proposal组成</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%A4%E9%98%B6%E6%AE%B5%E5%88%B0%E8%BE%BE"><span class="nav-number">1.4.</span> <span class="nav-text">两阶段到达</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%98%B6%E6%AE%B5%E4%B8%80%EF%BC%9A%E9%80%9A%E7%9F%A5%E5%87%86%E5%A4%87"><span class="nav-number">1.4.1.</span> <span class="nav-text">阶段一：通知准备</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%98%B6%E6%AE%B5%E4%BA%8C%EF%BC%9A%E9%80%9A%E7%9F%A5%E6%8E%A5%E5%8F%97"><span class="nav-number">1.4.2.</span> <span class="nav-text">阶段二：通知接受</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%A4%E9%98%B6%E6%AE%B5%E8%BF%87%E7%A8%8B"><span class="nav-number">1.5.</span> <span class="nav-text">两阶段过程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BC%BA%E7%82%B9"><span class="nav-number">1.6.</span> <span class="nav-text">缺点:</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Multi-Paxos"><span class="nav-number">2.</span> <span class="nav-text">Multi Paxos</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Raft-Consensus-Algorithm"><span class="nav-number">3.</span> <span class="nav-text">Raft Consensus Algorithm</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%89%E4%B8%AA%E7%8A%B6%E6%80%81"><span class="nav-number">3.1.</span> <span class="nav-text">三个状态</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%A4%E4%B8%AATime-Out"><span class="nav-number">3.2.</span> <span class="nav-text">两个Time Out</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Leader-election"><span class="nav-number">3.3.</span> <span class="nav-text">Leader election</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Log-Replition"><span class="nav-number">3.4.</span> <span class="nav-text">Log Replition</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ZAB%E7%AE%97%E6%B3%95"><span class="nav-number">4.</span> <span class="nav-text">ZAB算法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%80%BB%E7%BB%93"><span class="nav-number">5.</span> <span class="nav-text">总结</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">RunningEgg</p>
  <div class="site-description" itemprop="description">写下我的点点滴滴，写下我对这个世界的看法，还有我内心锁崇拜的技术</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">89</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">24</span>
        <span class="site-state-item-name">tags</span>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="mailto:guodh_1@163.com" title="E-Mail → mailto:guodh_1@163.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">RunningEgg</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> v5.3.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">Theme – <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  















  

  

</body>
</html>
